package com.xxb.system.feign.service.user;

import com.xxb.common.result.R;
import com.xxb.system.feign.callback.UserServiceFallBackFactory;
import com.xxb.system.feign.dto.user.*;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

/**
 * @author RenGaoshuai
 * @date 2023/7/20 18:22
 * @description
 */
@FeignClient(value = "xxb-service-user",fallback = UserServiceFallBackFactory.class)
public interface UserServiceFeign {

    /**
     * 登录
     *
     * @param dto
     * @return
     */
    @PostMapping("/user/login/login")
    R<LoginRespFeignDTO> login(@RequestBody LoginReqFeignDTO dto);

    /**
     * 修改用户手机号码
     *
     * @return
     * @paramp dto
     */
    @PostMapping("/user/manager/updateTel")
    R<String> updateUserTel(@RequestBody LoginTelReqFeignDTO dto);

    /**
     * 创建人脸识别
     *
     * @return
     * @paramp dto
     */
    @PostMapping("/user/manager/face/create")
    R<String> createUserFaceModel(@RequestBody LoginCreateFaceReqFeignDTO dto);

    /**
     * 验证人脸是否是同一个人
     *
     * @return
     * @paramp dto
     */
    @PostMapping("/user/manager/face/verify")
    R<String> verifyUserFaceModel(@RequestBody LoginVerifyFaceReqFeignDTO dto);

    /**
     * 修改用户信息
     *
     * @return
     * @paramp dto
     */
    @PostMapping("/user/manager/info/update")
    R<String> updateUserModel(@RequestBody UpdateUserReqFeignDTO dto);

    /**
     * 获取用户信息
     *
     * @return
     * @paramp dto
     */
//    @PostMapping(value = "/user/query/query",consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE)
    @PostMapping(value = "/user/query/query")
    R<QueryUserRespFeignDTO> queryUserInfo(@RequestBody QueryUserReqFeignDTO dto);

    /**
     * 获取用户信息
     *
     * @return
     * @paramp dto
     */
    @PostMapping("/user/query/get/{userId}")
    R getUserInfo(@PathVariable("userId") Long userId);
}
